# -*- coding: utf-8 -*-

# @File    : mysql_login.py
# @Date    : 2019-09-02
# @Author  : gongsunmolan
# !/usr/bin/python
# coding=utf-8
# 导入pymysql库
from pymysql import connect

try:
    conn = connect(
            host='localhost',
            port=3306,
            user='root',
            password='',
            db='wechat',
            charset='utf8')
    cursor = conn.cursor()
except Exception as e:
    print(e)
else:
    print('Connect Success:%s' % cursor)
